//
//  shopuserUNViewController.m
//  EasyToTesco
//
//  Created by mc on 16/3/11.
//  Copyright © 2016年 Jack. All rights reserved.
//

#import "shopuserUNViewController.h"
#import "AFNetworking.h"
#import "HeaderFileForEasyToTesco.h"

//付款方式view
#import "FkfsView.h"
//验证码
#import "CaptchaView.h"

#import "ReadLoginData.h"
#import "RKAlertView.h"

#import "SVProgressHUD.h"
#import "FFView.h"


#warning 点击余额  计算推广费 现金不需要二级密码

#define shopusermarc 10
#define shoplabelFont  [UIFont systemFontOfSize:15]
@interface shopuserUNViewController ()<UITextFieldDelegate, FFViewDelegate>
{
    NSString *fkfsStr;
    NSString *pwdStr;
    
//    UITextField *namefelid;
}

@property (nonatomic, strong)UITextField *goodsNameFelid;
@property (nonatomic, strong)UITextField *goodsNumFelid;
@property (nonatomic, strong)UITextField *jinefelid;
//@property (nonatomic, strong)UITextField *hyhfelid;
@property (nonatomic, strong)UITextField *Namefelid;
@property (nonatomic, strong)UITextField *yzmfelid;
@property (nonatomic, strong)CaptchaView *captchaView;
@property (nonatomic, strong)UILabel *tjfLabel;

@property (nonatomic,strong)FFView *zengSong;
@property (nonatomic,weak)FFView *YuE;

@property (nonatomic, strong)UITableView *shopUserUNtableview;
@end

@implementation shopuserUNViewController



- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    fkfsStr = @"2";
    pwdStr = @"0";
    [self addshopUNtopview];
//    [self shopuserUNd3atasources];
    
    
    [self addshopuserViewUI];
}

- (void)addshopUNtopview {
    
    UIImageView *image1 = [[UIImageView alloc] initWithFrame:CGRectMake(10, (self.secondView.frame.size.height-20)/2, 20, 20)];
    image1.image = [UIImage imageNamed:@"goback-icon.png"];
    [self.secondView addSubview:image1];
    self.leftBtn.hidden = YES;
    
    UIButton *goBackBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    goBackBtn.frame = CGRectMake(0, 0, self.secondView.frame.size.height, self.secondView.frame.size.height);
    [goBackBtn addTarget:self action:@selector(gobackClick) forControlEvents:UIControlEventTouchUpInside];
    [self.secondView addSubview:goBackBtn];
    self.titleLabel.text = @"商家合作专区";

}

- (void)gobackClick {
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)addshopuserViewUI {
    UILabel *titlelabel = [[UILabel alloc] initWithFrame:CGRectMake(shopusermarc, CGRectGetMaxY(self.secondView.frame)+20, 100, 30)];
    titlelabel.text = @"购买产品名称:";
    titlelabel.font = shoplabelFont;
    [self.view addSubview:titlelabel];
    
    UITextField *goodnamefelid = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetMaxX(titlelabel.frame) + 10, CGRectGetMaxY(self.secondView.frame)+20, WEITH-115-shopusermarc*2, 30)];
    goodnamefelid.delegate = self;
    goodnamefelid.placeholder = @" 请输入购买产品的名称";
    goodnamefelid.layer.borderWidth = 1;
    goodnamefelid.layer.cornerRadius = 5;
    goodnamefelid.layer.masksToBounds = YES;
    goodnamefelid.clearButtonMode = UITextFieldViewModeAlways;
    goodnamefelid.font = shoplabelFont;
    self.goodsNameFelid = goodnamefelid;
    [self.view addSubview:goodnamefelid];
    
    UILabel *titlelabel1 = [[UILabel alloc] initWithFrame:CGRectMake(shopusermarc, CGRectGetMaxY(titlelabel.frame)+15, 100, 30)];
    titlelabel1.text = @"购买产品数量:";
    titlelabel1.font = shoplabelFont;
    [self.view addSubview:titlelabel1];
    
    UITextField *numfelid = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetMaxX(titlelabel1.frame) + 10, CGRectGetMaxY(titlelabel.frame)+15, WEITH-115-shopusermarc*2, 30)];
    numfelid.delegate = self;
    numfelid.placeholder = @" 请输入购买产品的数量";
    numfelid.keyboardType  = UIKeyboardTypeNumberPad;
    numfelid.font = shoplabelFont;
    numfelid.delegate = self;
    numfelid.layer.borderWidth = 1;
    numfelid.layer.cornerRadius = 5;
    numfelid.layer.masksToBounds = YES;
    numfelid.clearButtonMode = UITextFieldViewModeAlways;
    self.goodsNumFelid = numfelid;
    [self.view addSubview:numfelid];
    
    
    UILabel *titlelabel11 = [[UILabel alloc] initWithFrame:CGRectMake(shopusermarc, CGRectGetMaxY(numfelid.frame)+15, 100, 40)];
    titlelabel11.text = @"会员支付方式:";
    
//    titlelabel11.layer.borderWidth = 1;
    titlelabel11.font = shoplabelFont;
    [self.view addSubview:titlelabel11];
    
    FFView *ffView1 = [[FFView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(titlelabel11.frame)+10, CGRectGetMaxY(numfelid.frame)+15, 100, 40)];
    ffView1.tag = 2;
    ffView1.delegate = self;
    [ffView1 addTarget:self action:@selector(FFBtnClick:) forControlEvents:UIControlEventTouchUpInside];
    ffView1.firstlabel.text = @"赠送积分";
    self.zengSong = ffView1;
    [self.view addSubview:ffView1];
    
    
    FFView *ffView2 = [[FFView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(ffView1.frame), CGRectGetMaxY(numfelid.frame)+15, 100, 40)];
    ffView2.tag = 1;
    ffView2.delegate = self;
    ffView2.firstlabel.text = @"现金";
    [ffView2 addTarget:self action:@selector(FFBtnClick:) forControlEvents:UIControlEventTouchUpInside];
    ffView2.firstview.backgroundColor = [UIColor whiteColor];
    self.YuE = ffView2;
    [self.view addSubview:ffView2];
    
    
    
//    FkfsView *fkfsView = [[FkfsView alloc] initWithFrame:CGRectMake(shopusermarc, CGRectGetMaxY(numfelid.frame)+5, WEITH-shopusermarc*2, 60)];
//    fkfsView.titlelabel.text = @"支付方式";
//    fkfsView.layer.borderWidth = 1;
//    fkfsView.layer.cornerRadius = 6;
//    fkfsView.layer.masksToBounds = YES;
//    //    fkfsView.backgroundColor = [UIColor yellowColor];
//    fkfsView.delegate = self;
//    [self.view addSubview:fkfsView];

    UILabel *titlelabel2 = [[UILabel alloc] initWithFrame:CGRectMake(shopusermarc, CGRectGetMaxY(titlelabel11.frame)+15, 100, 40)];
    titlelabel2.text = @"产品金额:";
    titlelabel2.font = shoplabelFont;
    
    [self.view addSubview:titlelabel2];
    
    UITextField *jinefelid = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetMaxX(titlelabel2.frame) + 10, CGRectGetMaxY(titlelabel11.frame)+20, WEITH-115-shopusermarc*2, 30)];
    jinefelid.delegate = self;
    jinefelid.placeholder = @" 请输入产品金额";
    jinefelid.keyboardType  = UIKeyboardTypeNumberPad;
    jinefelid.font = shoplabelFont;
#warning ...
    jinefelid.delegate = self;
    [jinefelid addTarget:self action:@selector(textFieldJINEDidChange:) forControlEvents:UIControlEventEditingDidEnd];
    jinefelid.layer.borderWidth = 1;
    jinefelid.layer.cornerRadius = 5;
    jinefelid.layer.masksToBounds = YES;
    jinefelid.clearButtonMode = UITextFieldViewModeAlways;
    self.jinefelid = jinefelid;
    [self.view addSubview:jinefelid];
    
    UILabel *titlelabel3 = [[UILabel alloc] initWithFrame:CGRectMake(shopusermarc, CGRectGetMaxY(jinefelid.frame)+15, 100, 40)];
    titlelabel3.text = @"产品推广费:";
    titlelabel3.font = shoplabelFont;
    [self.view addSubview:titlelabel3];
    
    
    UILabel *tgflabel = [[UILabel alloc] initWithFrame:CGRectMake(jinefelid.frame.origin.x, CGRectGetMaxY(jinefelid.frame)+15, 100, 40)];
    tgflabel.font = shoplabelFont;
    tgflabel.text = @"0.00";
    self.tjfLabel = tgflabel;
    [self.view addSubview:tgflabel];
    
//    UILabel *titlelabel4 = [[UILabel alloc] initWithFrame:CGRectMake(shopusermarc, CGRectGetMaxY(tgflabel.frame)+5, 100, 30)];
//    titlelabel4.text = @"会员号:";
//    titlelabel4.font = shoplabelFont;
//    [self.view addSubview:titlelabel4];
    
//    UITextField *hyfelid = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetMaxX(titlelabel1.frame), CGRectGetMaxY(tgflabel.frame)+5, WEITH-100-shopusermarc*2, 30)];
//    hyfelid.delegate = self;
//    hyfelid.placeholder = @"请输入会员号";
//    
//    hyfelid.layer.borderWidth = 1;
//    hyfelid.layer.cornerRadius = 5;
//    hyfelid.layer.masksToBounds = YES;
//    hyfelid.clearButtonMode = UITextFieldViewModeAlways;
////    hyfelid.keyboardType  = UIKeyboardTypeNumberPad;
//    hyfelid.font = shoplabelFont;
//    self.hyhfelid = hyfelid;
//    [self.view addSubview:hyfelid];
//    
    UILabel *titlelabel5 = [[UILabel alloc] initWithFrame:CGRectMake(shopusermarc, CGRectGetMaxY(tgflabel.frame)+15, 100, 40)];
    titlelabel5.text = @"用  户  名:";
    titlelabel5.font = shoplabelFont;
    [self.view addSubview:titlelabel5];
//
    UITextField *namefelid = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetMaxX(titlelabel5.frame) + 10, titlelabel5.frame.origin.y + 5, WEITH-115-shopusermarc*2, 30)];
    namefelid.delegate = self;
    namefelid.placeholder = @" 请输入用户名";
    namefelid.tag = 100;
    namefelid.delegate = self;
    namefelid.layer.borderWidth = 1;
    namefelid.layer.cornerRadius = 5;
    namefelid.layer.masksToBounds = YES;
    namefelid.clearButtonMode = UITextFieldViewModeAlways;
    namefelid.font = shoplabelFont;
    namefelid.keyboardType  = UIKeyboardTypeNumberPad;
    self.Namefelid = namefelid;
    [self.view addSubview:namefelid];
    
    UILabel *titlelabel6 = [[UILabel alloc] initWithFrame:CGRectMake(shopusermarc, CGRectGetMaxY(titlelabel5.frame)+15, 100, 40)];
    titlelabel6.text = @"验证码:";
    titlelabel6.font = shoplabelFont;
    [self.view addSubview:titlelabel6];
    
    UITextField *yzmfelid = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetMaxX(titlelabel6.frame) + 10, titlelabel6.frame.origin.y + 5, 100, 30)];
    yzmfelid.delegate = self;
    yzmfelid.tag = 101;
    yzmfelid.delegate = self;
    yzmfelid.layer.borderWidth = 1;
    yzmfelid.layer.cornerRadius = 5;
    yzmfelid.clearButtonMode = UITextFieldViewModeAlways;
    yzmfelid.layer.masksToBounds = YES;
    yzmfelid.placeholder = @" 请输入验证码";
    yzmfelid.keyboardType  = UIKeyboardTypeNumberPad;
    yzmfelid.font = shoplabelFont;
//    yzmfelid.backgroundColor = [UIColor greenColor];
    self.yzmfelid = yzmfelid;
    [self.view addSubview:yzmfelid];
    
    //显示验证码界面
     self.captchaView = [[CaptchaView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(yzmfelid.frame)+5, yzmfelid.frame.origin.y, 80, 30)];
    NSLog(@"%@",self.captchaView.changeString);
    [self.view addSubview:self.captchaView];
    
    UILabel *yanZhengMa = [[UILabel alloc] initWithFrame:CGRectMake(yzmfelid.frame.origin.x - 15, CGRectGetMaxY(yzmfelid.frame)+15, 250, 30)];
    
    yanZhengMa.text = @"*为确保您的交易安全,输入验证码前请确认信息";
    yanZhengMa.font = [UIFont systemFontOfSize:10];
    yanZhengMa.textColor = [UIColor redColor];
    yanZhengMa.layer.masksToBounds = YES;
    [self.view addSubview:yanZhengMa];
    
    UIButton *doneBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    doneBtn.frame = CGRectMake(shopusermarc*4, CGRectGetMaxY(self.captchaView.frame)+50, WEITH-shopusermarc*8, 30);
    doneBtn.backgroundColor = [UIColor blueColor];
    [doneBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [doneBtn setTitle:@"提交" forState:UIControlStateNormal];
    [doneBtn addTarget:self action:@selector(donbtnClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:doneBtn];
}



- (void)textFieldJINEDidChange:(UITextField *)textField {
 
    int num = textField.text.intValue;
    
    self.tjfLabel.text = [NSString stringWithFormat:@"%.2f",num * 0.08];
    
    NSLog(@"%d",textField.text.intValue);
    
}


- (void)donbtnClick{
    self.tjfLabel.text = [NSString stringWithFormat:@"%.2f",self.jinefelid.text.intValue * 0.08];
    
    NSDictionary *loginDic = [ReadLoginData readLoginData];
    if (loginDic.allKeys.count == 0) {
        UIAlertView *alview = [[UIAlertView alloc] initWithTitle:@"提示" message:@"您尚未进行登录,请登录后再进行您的操作" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
        [alview show];
    } else{
        if ((self.goodsNameFelid.text.length == 0)||(self.goodsNumFelid.text.length == 0)||(self.jinefelid.text.length == 0)||(self.Namefelid.text.length == 0)||(self.yzmfelid.text.length == 0)) {
            UIAlertView *alview = [[UIAlertView alloc] initWithTitle:@"提示" message:@"你的信息不完善,请完善您的输入信息" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
            
            [alview show];
        }else {
            if (([self.goodsNumFelid.text floatValue]<=0)||([self.jinefelid.text floatValue] <=0)) {
                UIAlertView *alview = [[UIAlertView alloc] initWithTitle:@"提示" message:@"金额和数量必须大于0,请检查输入是否有误" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
                [alview show];
            } else if (![self.yzmfelid.text isEqualToString:_captchaView.changeString]) {
                
                //验证不匹配，验证码和输入框晃动
                CAKeyframeAnimation *anim = [CAKeyframeAnimation animationWithKeyPath:@"transform.translation.x"];
                anim.repeatCount = 1;
                anim.values = @[@-20, @20, @-20];
                NSLog(@"%@",_captchaView.changeString);
                NSLog(@"%@",self.yzmfelid.text);
                [_captchaView.layer addAnimation:anim forKey:nil];
                [self.yzmfelid.layer addAnimation:anim forKey:nil];
            } else {
                //弹出密码输入框
                if ([fkfsStr isEqualToString:@"2"]) {
                    [RKAlertView showAlertPlainTextWithTitle:@"请输入二级密码" message:nil cancelTitle:@"取消" confirmTitle:@"确认" alertViewStyle:UIAlertViewStylePlainTextInput confrimBlock:^(UIAlertView *alertView) {
                        NSLog(@"确认了输入：%@",[alertView textFieldAtIndex:0].text);
                        pwdStr = [alertView textFieldAtIndex:0].text;
                        NSLog(@"%@",pwdStr);
                        [self shopuserUNdatasources];
                        
                    } cancelBlock:^{
                        //       NSLog(@"取消了");
                    }];
                } else {
                    [self shopuserUNdatasources];
                }

            }
        }
    
    }

    
}

#pragma mark --- FFViewDelegate
-(void)FFBtnClick:(UIButton *)button {
    
    if (button.tag == 2) {
        fkfsStr = @"赠送积分";
        fkfsStr = @"2";
        NSLog(@"%@",fkfsStr);
        self.zengSong.firstview.backgroundColor = [UIColor greenColor];
        self.YuE.firstview.backgroundColor = [UIColor whiteColor];
        
    } else {
        fkfsStr = @"余额";
        fkfsStr = @"1";
        NSLog(@"%@",fkfsStr);
//        NSLog(@"%ld",(long)button.tag);
        self.YuE.firstview.backgroundColor = [UIColor greenColor];
        self.zengSong.firstview.backgroundColor = [UIColor whiteColor];
        
    }
}


//开始编辑输入框的时候，软键盘出现，执行此事件
-(void)textFieldDidBeginEditing:(UITextField *)textField
{
    if (textField.tag == 101|| textField.tag == 100) {
        CGRect frame = textField.frame;
        int offset = frame.origin.y + 80 - (self.view.frame.size.height - 216.0);//键盘高度216
        
        //将视图的Y坐标向上移动offset个单位，以使下面腾出地方用于软键盘的显示
        if(offset > 0)
            self.view.frame = CGRectMake(0.0f, -offset, self.view.frame.size.width, self.view.frame.size.height);
        
        [UIView commitAnimations];
        
    }
    
    
}


//当用户按下return键或者按回车键，keyboard消失
-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
    self.tjfLabel.text = [NSString stringWithFormat:@"%f", [self.jinefelid.text floatValue]*0.8];
    [textField resignFirstResponder];
    
    if (textField == self.yzmfelid) {
        //判断输入的是否为验证图片显示的验证码
        if (![textField.text isEqualToString:_captchaView.changeString]) {
            
            //验证不匹配，验证码和输入框晃动
            CAKeyframeAnimation *anim = [CAKeyframeAnimation animationWithKeyPath:@"transform.translation.x"];
            anim.repeatCount = 1;
            anim.values = @[@-20, @20, @-20];
            [_captchaView.layer addAnimation:anim forKey:nil];
            [textField.layer addAnimation:anim forKey:nil];
        }
    }

    return YES;
}

//实时监控键盘的状态
- (void)textFieldDidChange:(UITextField *)textField
{
    if (textField.tag == 101) {
        if (textField.text.length>4) {
            textField.text = [textField.text substringToIndex:12];
        }
        if (textField.text.length == 4) {
            if (![textField.text isEqualToString:_captchaView.changeString]) {
                
                //验证不匹配，验证码和输入框晃动
                CAKeyframeAnimation *anim = [CAKeyframeAnimation animationWithKeyPath:@"transform.translation.x"];
                anim.repeatCount = 1;
                anim.values = @[@-20, @20, @-20];
                [_captchaView.layer addAnimation:anim forKey:nil];
                [textField.layer addAnimation:anim forKey:nil];
            }

        }
    }
    

}

//输入框编辑完成以后，将视图恢复到原始状态
-(void)textFieldDidEndEditing:(UITextField *)textField
{
    self.view.frame =CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
//    NSLog(@"%@", textField.text);
}

- (void)shopuserUNdatasources {
        AFHTTPSessionManager *mgr = [AFHTTPSessionManager manager];
    mgr.responseSerializer = [AFHTTPResponseSerializer serializer];
//    商品名称: 商品数量
    NSString *title = [NSString stringWithFormat:@"%@,%@", self.goodsNameFelid.text, self.goodsNumFelid.text];
    //金额
    NSString *jine = [NSString stringWithFormat:@"%@", self.jinefelid.text];
    //付款方法
    NSString *fkfs = fkfsStr;
    NSDictionary *nameDic = [ReadLoginData readLoginData];
    
    
    //用户名
    NSString *username = [NSString stringWithFormat:@"%@", [nameDic[@"data"] objectForKey:@"username"]];
    //姓名
    NSString *uname = self.Namefelid.text;
    NSString *pwdtwo = pwdStr;
    
    NSDictionary *param =
  @{@"title":[NSString stringWithFormat:@"%@", title],
    @"jine":[NSString stringWithFormat:@"%@", jine],
    @"fkfs":[NSString stringWithFormat:@"%@", fkfs],
    @"username":[NSString stringWithFormat:@"%@", uname],
    @"uname":[NSString stringWithFormat:@"%@", username],
    @"pwdtwo":[NSString stringWithFormat:@"%@", pwdtwo]};
    
//    NSDictionary *param = @{
//                            @"title":@"zhifubao",
//                            @"jine":@200,
//                            @"fkfs":@1,
//                            @"username":@18620614920,
//                            @"uname":@18000000000,
//                            
//                                };
    

    [mgr POST:@"http://www.ylgw8.com/AppHz/Hz" parameters:param success:^(NSURLSessionDataTask *task, id responseObject) {
        NSDictionary *string = [self toArrayOrNSDictionary:responseObject];
        NSLog(@"%@",string);
        NSLog(@"%@",[string objectForKey:@"code"]);
//        if ([[string objectForKey:@"code"] isEqualToString:@"1"]) {
//            NSLog(@"%@",string);
//            
//            UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:@"数据请求成功!" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
//            [alertView show];
//
//        } else {
//            UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:[NSString stringWithFormat:@"%@",[string objectForKey:@"message"]] delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
//            [alertView show];
//        }
//    
      
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:[NSString stringWithFormat:@"%@",[string objectForKey:@"message"]]
                                                           delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
        [alertView show];
        
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        
    }];
}

// 将JSON串转化为字典或者数组
- (id)toArrayOrNSDictionary:(NSData *)jsonData{
    NSError *error = nil;
    id jsonObject = [NSJSONSerialization JSONObjectWithData:jsonData
                                                    options:NSJSONReadingAllowFragments
                                                      error:&error];
    
    if (jsonObject != nil && error == nil){
        return jsonObject;
    }else{
        // 解析错误
        return nil;
    }
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

//触摸空白处回收键盘
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
    self.tjfLabel.text = [NSString stringWithFormat:@"%f", [self.jinefelid.text floatValue]*0.8];
    [self.goodsNumFelid resignFirstResponder];
    [self.jinefelid resignFirstResponder];
    //    [self.hyhfelid resignFirstResponder];
    [self.Namefelid resignFirstResponder];
    [self.yzmfelid resignFirstResponder];
    [self.goodsNameFelid resignFirstResponder];
    
    self.tjfLabel.text = [NSString stringWithFormat:@"%.2f",self.jinefelid.text.intValue * 0.08];
}


#pragma UIAlertViewDelegate

- (BOOL)textFieldShouldClear:(UITextField *)textField {
//    textField 
    
    return YES;
}

- (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex {
    
    NSLog(@"%s",__func__);
    
    [self clearAlertView];
}

- (void)clearAlertView{
    self.jinefelid.text = @"";
    self.Namefelid.text = @"";
    self.yzmfelid.text = @"";
    self.goodsNameFelid.text = @"";
    self.goodsNumFelid.text = @"";
}



@end
